function [choiceFull,Nu,pp,ppFull,tc,tcFull,tcidx,uidx] = dreumDataProc3(compile)
% Process data from file if compile = 0 or load pre-processed data from
% file if compile = 1

if compile == 1 
    
    K = [10, 10];
    
    data = cell(1,2);

    % Import data, compile into usable data matrix
    dataIn = csvread('data_08.csv',1,0);
    data{1} = dataIn;
    dataIn = csvread('data_09.csv',1,0);
    data{2} = dataIn;
    
    N = size(dataIn,1); % Number of individuals
    % Columns: 1) Individual ID, 2) Hunt 1, 3)PP Stock,
    %          4-end) mc, oc, nearby, nearby.distance, characteristics
                                      
    choiceFull = zeros(size(data{2},1),2);
    ppFull = cell(1,2);
    for idx1 = 1:2
        choiceFull(:,idx1) = data{idx1}(:,2); % Individuals' 1st-rd choices 
        ppFull{idx1} = data{idx1}(:,3); % Individuals' preference point stock
    end

% Calculate number of unique individuals (Nu) (defined by unique  tc, oc combos)
tcFull = min(10,max(1,floor((data{1}(:,4:25) + 1/3*data{1}(:,26:47))*100/200))); % Discretize travel costs
dataFull = cell(1,2);
dataFull{1} = [ppFull{1} tcFull];
dataFull{2} = [ppFull{2} tcFull];
[~,uidx,tcidx] = unique(dataFull{1},'rows');
pp{1} = dataFull{1}(uidx,1);
pp{2} = dataFull{2}(uidx,1);
tc = dataFull{1}(uidx,2:end);
Nu = size(pp{1},1);

save('dreumDataProcessed.mat');

else 

    load('dreumDataProcessed.mat');

end

